package com.rongmai.web.bo;

import com.rongmai.db.mapper.UserBusinessMapper;
import com.rongmai.db.model.UserBusiness;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Slf4j
@Service
public class UserBusinessBo {

    @Resource
    private UserBusinessMapper userBusinessMapper;

    public void save(UserBusiness userBusiness) {
        userBusiness.setCreateTime(new Date());
        userBusinessMapper.insert(userBusiness);
    }

    public void deleteByUserId(Integer userId) {
        userBusinessMapper.deleteByUserId(userId);
    }

    public List<UserBusiness> queryByUserId(Integer userId) {
        return userBusinessMapper.queryByUserId(userId);
    }
}
